home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '90 / MacHack'90 Proceedings / John Norstad / Reusable Code / Source / makefile < prev    next >
Encoding:
Makefile  |  1990-06-10  |  5.9 KB  |  239 lines  |  [TEXT/MPS ]

  1. #    makefile - Sample program make file.
  2. #
  3. #    Copyright © 1988, 1989, 1990 Northwestern University.  Permission is 
  4. #    granted to use this code in your own projects, provided you give credit 
  5. #    to both John Norstad and Northwestern University in your about box or 
  6. #    document.
  7. #
  8. #    Targets:
  9. #    --------
  10. #
  11. #    Sample - The sample program.
  12. #    wrap, cvrt - Tools.
  13. #
  14. #    Shell scripts:
  15. #    --------------
  16. #
  17. #    rel - Build release version.
  18. #
  19. #    Tools.  Reusable.
  20. #    -----------------
  21. #    
  22. #    wrap - Wrap paragraphs.
  23. #    cvrt - Compile document.
  24. #    
  25. #    General-purpose C modules.  Reusable:
  26. #    -------------------------------------
  27. #    
  28. #    utl - Utilities.
  29. #    gff - Get file or folder.
  30. #    vol - Volume selection.
  31. #    scn - Volume scanning.
  32. #    rep - Report manager.
  33. #    rpp - Report printing manager.
  34. #    ldf - Custom list definition function for reports.
  35. #    hlp - Help window manager.
  36. #    
  37. #    Other C Modules.  Not reusable:
  38. #    -------------------------------
  39. #    
  40. #  vscn - Scanning manager.
  41. #  vmsg - Message manager.
  42. #    glob - Global definitions.
  43. #    init - Initialization.
  44. #    misc - Miscellany.
  45. #    wstm - Window state manager.
  46. #    abou - About window manager.
  47. #    help - Help window manager.
  48. #    pref - Preferences window manager.
  49. #    main - Main window manager.
  50. #    prog - Main program.
  51. #    
  52. #    precompile - Precompile standard system header files.
  53. #
  54. #    Assembler modules:
  55. #    ------------------
  56. #
  57. #    unmount - UnmountVol trap patch.
  58. #
  59. #    Resource files:
  60. #    ---------------
  61. #
  62. #    pict.r - Pictures.
  63. #    rez.r - All other resources.
  64. #
  65. #    Other files:
  66. #    ------------
  67. #
  68. #    rez.h - Constant definitions for the resources.
  69. #    doc - About box text as maintained in MS Word.
  70. #    rephead.t - Initial text for the report field.
  71. #    picts - Pictures (PICT resources).
  72. #
  73. #    C Coding conventions:
  74. #    ---------------------
  75. #
  76. #    Public reusable c modules have three character names.
  77. #    Private c modules have four character names.
  78. #
  79. #    References to exported types and functions are always qualified 
  80. #    by the module name:
  81. #
  82. #        module name_type name
  83. #        module name_function name
  84. #
  85. #    e.g., prog_DoEvent.
  86. #
  87. #    Global variable and type names have their first letter capitalized.
  88. #    Local variable and type names have their first letter in lower case.
  89. #    Module names are all lower case.
  90. #    Constant names are all lower case.
  91. #
  92. #    With a few exceptions, all code in a module is placed in its own 
  93. #    segment, with the segment name equal to the module name.  The segments
  94. #    are combined in the link command.
  95.  
  96.  
  97. #    Assembly, compilation, and linking options.
  98. #
  99. #    The debugging options should be turned off when building release versions.  
  100. #    See the "rel" shell script.
  101.  
  102. AOptions = -wb
  103. COptions = -mbg ch8 -sym on -r
  104. LDebugOptions = -sym on
  105.  
  106. #    Object files.
  107.  
  108. ObjFiles =     prog.c.o ∂
  109.             main.c.o ∂
  110.             glob.c.o ∂
  111.             vol.c.o ∂
  112.             scn.c.o ∂
  113.             rep.c.o ∂
  114.             rpp.c.o ∂
  115.             hlp.c.o ∂
  116.             gff.c.o ∂
  117.             utl.c.o ∂
  118.             abou.c.o ∂
  119.             wstm.c.o ∂
  120.             init.c.o ∂
  121.             misc.c.o ∂
  122.             pref.c.o ∂
  123.             help.c.o ∂
  124.             vscn.c.o ∂
  125.             vmsg.c.o ∂
  126.             unmount.a.o
  127.  
  128. #    Additional dependencies for C and assembler modules.  MPW's default
  129. #    rules and build commands are used for these modules.
  130.  
  131. abou.c.o ƒ precompile utl.h rez.h rpp.h glob.h wstm.h abou.h help.h
  132. gff.c.o ƒ precompile gff.h
  133. glob.c.o ƒ precompile rpp.h rez.h glob.h
  134. help.c.o ƒ precompile utl.h rpp.h rez.h hlp.h glob.h ∂
  135.     wstm.h help.h misc.h main.h unmount.h vol.h
  136. hlp.c.o ƒ precompile rep.h rpp.h utl.h hlp.h doc.h
  137. init.c.o ƒ precompile utl.h rpp.h rez.h glob.h ∂
  138.     pref.h help.h init.h misc.h main.h abou.h
  139. main.c.o ƒ precompile vol.h rep.h rpp.h scn.h utl.h rez.h glob.h ∂
  140.     wstm.h misc.h vscn.h vmsg.h help.h prog.h main.h unmount.h
  141. misc.c.o ƒ precompile utl.h rep.h rpp.h scn.h vol.h rez.h glob.h ∂
  142.     vmsg.h unmount.h misc.h wstm.h unmount.h prog.h main.h vscn.h
  143. pref.c.o ƒ precompile utl.h rpp.h rez.h glob.h wstm.h pref.h help.h
  144. prog.c.o ƒ precompile vol.h scn.h rep.h rpp.h hlp.h utl.h rez.h ∂
  145.     glob.h wstm.h vmsg.h abou.h pref.h help.h misc.h ∂
  146.     vscn.h init.h prog.h main.h
  147. rep.c.o ƒ precompile rep.h utl.h doc.h
  148. rpp.c.o ƒ precompile rpp.h utl.h doc.h
  149. scn.c.o ƒ precompile scn.h utl.h
  150. utl.c.o ƒ precompile utl.h
  151. vmsg.c.o ƒ precompile utl.h rep.h scn.h vol.h rpp.h rez.h glob.h ∂
  152.     vmsg.h
  153. vol.c.o ƒ precompile vol.h utl.h
  154. vscn.c.o ƒ precompile utl.h rpp.h rep.h vol.h rez.h scn.h gff.h ∂
  155.     glob.h vmsg.h misc.h vscn.h main.h prog.h
  156. wstm.c.o ƒ precompile utl.h rpp.h rez.h glob.h wstm.h
  157. crc.a.o ƒ precompile crc.h
  158. bct.a.o ƒ precompile bct.h
  159. unmount.a.o ƒ precompile unmount.h
  160.  
  161. #    Precompiled system headers.
  162.  
  163. precompile ƒ precompile.c
  164.     C {COptions} precompile.c
  165.  
  166. #    List definition procedure.
  167.  
  168. ldf.c.o ƒ ldf.c doc.h precompile
  169.     C {COptions} ldf.c -o ldf.c.o -r -w
  170.     
  171. #    Sample dependencies.
  172.  
  173. Sample ƒƒ rez.r picts
  174.     Rez rez.r -a -o Sample
  175.     
  176. Sample ƒƒ rephead.t cvrt
  177.     cvrt rephead.t -o Sample -i 300
  178.     
  179. Sample ƒƒ doc wrap cvrt picts
  180.     wrap -r 335 -p <doc >wraptemp 
  181.     cvrt wraptemp -o Sample -i 200 -t 128 -g 128 -c 128 ∂
  182.         -p picts -w 345 -h 12
  183.     delete wraptemp
  184.  
  185. Sample ƒƒ {ObjFiles}
  186.     Link -t APPL -c SAMP -ra =$30 {LDebugOptions} ∂
  187.         -sg main1seg=Main,prog,utl,misc,main ∂
  188.         -sg main2seg=crc,bct,wstm,vol,rep,repi,msci,scn ∂
  189.         -sg initseg=init,voli ∂
  190.         -sg auxseg=abou,help,pref,hlp,gff ∂
  191.         -sg rppseg=rpp ∂
  192.         {ObjFiles} ∂
  193.         "{Libraries}"Interface.o ∂
  194.         "{CLibraries}"CRuntime.o ∂
  195.         "{CLibraries}"StdCLib.o ∂
  196.         "{CLibraries}"CInterface.o ∂
  197.         -o Sample
  198.     setfile -a BM Sample
  199.         
  200. Sample ƒƒ ldf.c.o
  201.     Link -rt LDEF=128 -m MYLIST ∂
  202.          ldf.c.o ∂
  203.         "{Libraries}"Interface.o ∂
  204.         -o Sample
  205.         
  206. #    wrap tool.        
  207.         
  208. wrap.c.o ƒ wrap.c precompile
  209.     C {COptions} wrap.c -w
  210.     
  211. wrapObjects = wrap.c.o
  212.  
  213. wrap ƒ {wrapObjects}
  214.     Link -w -c 'MPS ' -t MPST ∂
  215.         {wrapObjects} ∂
  216.         "{Libraries}"stubs.o ∂
  217.         "{CLibraries}"CRuntime.o ∂
  218.         "{Libraries}"Interface.o ∂
  219.         "{CLibraries}"StdCLib.o ∂
  220.         "{CLibraries}"CInterface.o ∂
  221.         -o wrap
  222.         
  223. #    cvrt tool.        
  224.         
  225. cvrt.c.o ƒ cvrt.c doc.h precompile
  226.     C {COptions} cvrt.c
  227.     
  228. cvrtObjects = cvrt.c.o
  229.  
  230. cvrt ƒ {cvrtObjects}
  231.     Link -w -c 'MPS ' -t MPST ∂
  232.         {cvrtObjects} ∂
  233.         "{Libraries}"stubs.o ∂
  234.         "{CLibraries}"CRuntime.o ∂
  235.         "{Libraries}"Interface.o ∂
  236.         "{CLibraries}"StdCLib.o ∂
  237.         "{CLibraries}"CInterface.o ∂
  238.         -o cvrt
  239.